package org.zhxy.model.context;

import org.springframework.stereotype.Component;
import org.zhxy.model.entity.Admin;


public class LoginContextHolder {
    private static final ThreadLocal<Integer> id = new ThreadLocal<>();
    private static final ThreadLocal<Integer> type = new ThreadLocal<>();

    public static void setUserId(Integer userId) {
        id.set(userId);
    }

    public static Integer getUserId() {
        return id.get();
    }

    public static void setUserType(Integer userType) {
        type.set(userType);
    }

    public static Integer getUserType() {
        return type.get();
    }

    public static void clear() {
        id.remove();
        type.remove();
    }
}
